package com.sy.jtabytetcc;

import org.bytesoft.bytetcc.supports.springboot.config.SpringBootSecondaryConfiguration;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@Import(SpringBootSecondaryConfiguration.class)
@EnableJpaRepositories(transactionManagerRef = "jtaTransactionManager") 
@SpringBootApplication
@EnableFeignClients("com.sy.jtabytetcc.feign")
@EnableAutoConfiguration(exclude = { MongoAutoConfiguration.class }) // 使用文件存储时, 不需要配置mongodb
/**
 * 
 * JPA框架默认使用 transactionManager事务管理器（类型为PlatformTransactionManager）。bytetcc使用的事务管理器beanId为jtaTransactionManager。
*org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'transactionManager' is expected to be of type 'org.springframework.transaction.PlatformTransactionManager' but was actually of type 'org.bytesoft.bytetcc.TransactionManagerImpl
*@EnableJpaRepositories
*/
public class JtaBytetccMainApplication {

	public static void main(String[] args) {
		SpringApplication.run(JtaBytetccMainApplication.class, args);
	}

}
